package com.welove.widget;

import com.welove.R;

import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * @ClassName: TitleBar
 * @Description: 所有继承BaseActivity的界面TitleBar
 * @author dreamfutureba@gmail.com
 * @date 2013年11月4日 下午2:35:06
 * 
 */
public class TitleBar extends LinearLayout {
	private static final String TAG = TitleBar.class.getSimpleName();

	private Context mContext;
	private LayoutInflater mInflater;
	private Resources mRes;

	// 通用的titlebar
	public TextView titlebar_tv_center;// 中间的文本
	public Button titlebar_btn_left;// 左边的按钮
	public Button titlebar_btn_right;

	public TitleBar(Context context) {
		super(context);
		init(context);
	}

	public TitleBar(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	private void init(Context context) {
		this.mContext = context;
		mRes = getResources();
		mInflater = LayoutInflater.from(mContext);

		mInflater.inflate(R.layout.view_title_bar, this);
		titlebar_tv_center=(TextView) findViewById(R.id.titlebar_tv_center);
		titlebar_btn_left=(Button) findViewById(R.id.titlebar_btn_left);
		titlebar_btn_right=(Button) findViewById(R.id.titlebar_btn_right);
	}

}
